package com.bfly.mall.user.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.bfly.mall.user.enums.GenderType;
import com.bfly.mall.user.enums.PlatformType;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户列表DTO
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/15 21:25
 */
public class UserListDTO implements Serializable {


    private static final long serialVersionUID = -5720206005901397500L;
    private int id;
    private String nickName;
    private String phone;
    private int gender;
    private String avatarUrl;
    private boolean enable;
    private Date lastLoginDate;
    private Date createDate;
    private String lastLoginIp;
    private int platform;

    private String city;
    private String country;
    private String province;
    private String language;
    private Date subscribeTime;
    private boolean subscribe;

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(Date subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public boolean isSubscribe() {
        return subscribe;
    }

    public void setSubscribe(boolean subscribe) {
        this.subscribe = subscribe;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPlatformName() {
        PlatformType type = PlatformType.getPlatformType(getPlatform());
        return type == null ? "" : type.getName();
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public int getPlatform() {
        return platform;
    }

    public void setPlatform(int platform) {
        this.platform = platform;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 性别名称
     *
     * @author 长沙商脉科技有限公司
     * @date 2020/9/18 14:55
     */
    public String getGenderName() {
        GenderType type = GenderType.getGender(getGender());
        return type == null ? "未知" : type.getName();
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getEnableName() {
        return isEnable() ? "激活" : "冻结";
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }
}
